void loading()
{
	set_color(WHITE);

	cout << "Welcome player. In a few seconds you will be in the wonderful world of ..... Please enter your name : ";
	cin >> player.name;
	cout << endl;

	cout << "Loading..." << endl;

	loadItems();
	loadCharacters();
	loadQuests();
	loadLocations();
	loadSkills();
}


void story()
{
	cout << "\t\t\t Welcome to the big RPG" << endl << endl;
	cout << "This is the country Albion You live a prosperous life as a farmer in the great forest You live quite a happy life but you have always craved adventure. Your society is a sheltered one and you have never known anyone outside. You have heard rumours about other cultures, many stories have been told by the other travelers in the tavern. Stories of Dragons, beautiful women and gold." << endl << endl;
	cout << "Many weeks pass...." << endl << endl;
	cout << "One day, disaster strikes. Bandits storm your farm. Terrified you hide away in the barn and watch as they frenziedly slaughter your cows. They raid your humble little house and steal most of your posetions. The town guard come to help defend your farm but there are too many bandits. Many of the guards die, the blood stains your land. Shaking, you pick yourself up and head outside when you are sure the struggle is over." << endl << endl;
	cout << "You see a rusty sword and sheild on the ground near the body of one of the bandits. Feeling a new excitement build up inside you, you pick up the sword and do a few practice swings. It is time to go and prove yourself." << endl << endl;

	player.currentLocation = forest[1][3];
	system("pause");
}

void loadItems()
{
	//load the nooby armor your character will enevitably be wearing
	clothCap.name = "Cloth Cap";
	clothCap.description = "Simple cloth cap that looks many years old. \n\nDefence = 0 \nRequires Level 0. \nWorth 2 Gold";
	clothCap.rarerity = GREY;
	clothCap.bonus = 0;
	clothCap.levelRequirement = 0;
	clothCap.price = 2;
	clothCap.type = HEAD_ARMOR;

	clothShirt.name = "Cloth Shirt";
	clothShirt.description = "This shirt is a little bit old but very comfortable. \n\nDefence = 2 \nRequires Level 0. \nWorth 3 Gold";
	clothShirt.rarerity = GREY;
	clothShirt.bonus = 2;
	clothShirt.levelRequirement = 0;
	clothShirt.price = 3;
	clothShirt.type = CHEST_ARMOR;

	clothTrousers.name = "Cloth Trousers";
	clothTrousers.description = "Nearly worn through cloth trousers. \n\nDefence = 1 \nRequires Level 0 \nWorth 2 Gold";
	clothTrousers.rarerity = GREY;
	clothTrousers.bonus = 1;
	clothTrousers.levelRequirement = 0;
	clothTrousers.price = 2;
	clothTrousers.type = LEG_ARMOR;

	clothBoots.name = "Cloth Boots";
	clothBoots.description = "Boots that have nothing but the basic function of keeping your feet from the ground. \n\nDefence = 0 \nRequirest Level 0 \nWorth 1 Gold";
	clothBoots.rarerity = GREY;
	clothBoots.bonus = 0;
	clothBoots.levelRequirement = 0;
	clothBoots.price = 1;
	clothBoots.type = FOOT_ARMOR;

	rustySheild.name = "Rusty Sheild";
	rustySheild.description = "This shield looks like it has been abandoned and forgotten about for a long time, it is almost falling appart in your hands but it looks sturdy enough to defend against some basic attacks. \n\nDefence = 2 \nLevel Requirement = 0 \nWorth = 3";
	rustySheild.rarerity = GREY;
	rustySheild.bonus = 2;
	rustySheild.levelRequirement = 0;
	rustySheild.price = 3;
	rustySheild.type = HELD_ARMOR;

	//declair nooby weaponry :)
	rustySword.name = "Rusty Sword";
	rustySword.description = "A rusty sword...looks like it might do some damage but looks better suited in a museum. \n\nDamage = 1-6 \nWorth 5 Gold";
	rustySword.rarerity = GREY;
	rustySword.effect = 1;
	rustySword.maxEffect = 6;
	rustySword.price = 5;
	rustySword.type = WEAPON;

	//load the not so nooby armor your character will enevitably be wearing
	leatherCap.name = "Leather Cap";
	leatherCap.description = "A leather cap. Looks a bit worn and cracked. \n\nDefence = 4 \nRequires Level 3. \nWorth 10 Gold";
	leatherCap.rarerity = WHITE;
	leatherCap.bonus = 4;
	leatherCap.levelRequirement = 3;
	leatherCap.price = 10;
	leatherCap.type = HEAD_ARMOR;
}
void set_color(int a)
{
	HANDLE handle = GetStdHandle( STD_OUTPUT_HANDLE ); // Make a handle
	SetConsoleTextAttribute( handle, a ); // Set the color of the text
}


void loadCharacters()
{
	//set up the nooby stats
	player.description = "You used to be a simple farmer but now you have the taste for adventure.";
	player.level = 1;
	player.exp = 0;
	player.gold = 0;

	player.HP = 200;
	player.currentHP = 200;

	player.MP = 50;
	player.currentMP = 50;

	player.strength = 5;
	player.magic = 5;
	player.defence = 0;
	player.agility = 5;

	player.fishingLevel = 0;
	player.miningLevel = 0;
	player.cookingLevel = 0;
	player.blackSmithLevel = 0;
	player.treeLevel = 0;
	player.woodWorkLevel = 0;

	//set up the characters equipment
	player.armorHead = clothCap;
	player.armorChest = clothShirt;
	player.armorLegs = clothTrousers;
	player.armorFeet = clothBoots;

	player.mainHand = rustySword;
	player.offHand = rustySheild;
}

void loadQuests()
{
	//set up the first quest
	banditRaid.QuestNumber = 1;
	banditRaid.colour = YELLOW;
	banditRaid.name = "Bandit Raid (Storyline)";
	banditRaid.dialogue = "Guard: Oh hey there " + player.name + " we thought the bandits got you, glad to see you are ok. The bandits have killed many of our men, we are to weak to persue them ourselves now as we need to keep the town defended, would you like to go instead? A one man strike team will be far more effective then an army in any case. \n\n1. Yes I will go and avenge us all! \n2.No way! I'll leave that to the guard!";
	banditRaid.description1 = "Kill the bandit leader./n/nEXP = 200(at level 5)/nGold = 200";
	banditRaid.description2 = "Bandits have slaughtered your cattle and run off with your posetions, persue the bandit leader and extract your revenge";
	banditRaid.description3 = "You have found the bandit camp. It is time to hunt down those bastards and get your revenge.";
	banditRaid.description4 = "You have completed the quest, searching the leaders clothing you find 200 gold pieces.";
	banditRaid.status = UNDESCOVERED;
	banditRaid.expReward = 1000;
	banditRaid.goldReward = 200;
}

void loadLocations()
{
	//the starting area :D
	forest[1][3].area = "You are in a large clearing in the Great Forest";
	forest[1][3].areaDescription  = "This is your farm...You can see the barn you hid in when the bandits raided. The blood from the battle is still there, stained perminantly in the ground. There is 1 exit to the East";
	forest[1][3].east = true;
	forest[1][3].xPosition = 1;
	forest[1][3].yPosition = 3;

	//define the next area
	forest[2][3].area = "You are in a large clearing in the Great Forest";
	forest[2][3].areaDescription = "You are in a large area, it is one of your feilds. There is a town guard standing here looking at the carnage of the bandit raid. He notices you, wipes his eyes and tries (unsucesfully) a smile. He hails to you and invites you to go and talk to him.";
	forest[2][3].west = true;
	forest[2][3].north = true;
	forest[2][3].nameOfAreaOfInterest = "guard";
	forest[2][3].areaOfInterestDescription = "The guard stands there in his traditional town armor. He looks very distressed at the loss of his collegues but still looks like he wants to talk to you.";
	forest[2][3].xPosition = 2;
	forest[2][3].yPosition = 3;
}

void loadSkills()
{
	//load spells
	heal1.name = "Minor Heal";
	heal1.skillDescription = "A simple healing spell to cure the most basic of wounds.";
	heal1.castingDescription = "You rase your hands, make a spiral gesture about your head and touch yourself healing yourself";
	heal1.mpCost = 10;
	heal1.type = HOLY;
	heal1.damage = -30; //lolololol a minus damage yep health - - 30 = health + 30 :D:D:D
	heal1.spellLevel = 1;
	heal1.spellExp = 0;
}
